package com.collaboration.proton.services;

import com.collaboration.proton.dao.UserHeroRepository;
import com.collaboration.proton.entities.Player;
import com.collaboration.proton.entities.UserHero;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author vybfi
 * @param
 * @return 无
 *
 */
@Service
public class UserHeroService {

    @Autowired
    UserHeroRepository userHeroRepository;

    public UserHero save(UserHero userHero){
        return userHeroRepository.save(userHero);
    }

    public List<UserHero> getAll(){
        return userHeroRepository.findAll();
    }

    public UserHero findUserHeroByPlayer(Player player){
        return userHeroRepository.findUserHeroByPlayer(player);
    }

}
